package com.alameda.controller.v1.user;

import com.alameda.common.result.Result;
import com.alameda.service.user.AdUserOperateLogService;
import com.alameda.user.dto.AdUserOperateLogDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户操作日志 前端控制层
 *
 * @author Lv
 * @date 2025/01/01
 */
@Api(tags = "用户操作日志")
@RestController
@RequestMapping("/ad_user_operate_log")
public class AdUserOperateLogController {

    @Autowired
    private AdUserOperateLogService adUserOperateLogService;

    /**
     * 读取用户操作信息
     *
     * @param adUserOperateLogDTO 用户操作日志信息
     * @return
     */
    @ApiOperation("读取用户操作日志信息")
    @PostMapping("/list_user_operate_info")
    public Result<?> listUserOperateInfo(@RequestBody AdUserOperateLogDTO adUserOperateLogDTO) {
        return Result.success(adUserOperateLogService.listUserOperateInfo(adUserOperateLogDTO));
    }

    /**
     * 导出excel
     *
     * @param adUserOperateLogDTO 用户操作日志信息
     */
    @ApiOperation("导出excel")
    @PostMapping("/export_excel")
    public void exportExcel(@RequestBody AdUserOperateLogDTO adUserOperateLogDTO) {
        adUserOperateLogService.exportExcel(adUserOperateLogDTO);
    }
}

